package com.example.webpractice.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.webpractice.dao.ConfigDao;
import com.example.webpractice.po.ConfigPO;
import com.example.webpractice.vo.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 系统配置
 */
@Service("configService")
public class ConfigService {
    @Autowired
    private ConfigDao dao;

    public PageVo queryAll(QueryWrapper queryWrapper) {
        List<ConfigPO> lists = dao.selectList(queryWrapper);
        return new PageVo(lists, lists.size(), 0, 0);
    }

    public ConfigPO selectOne(QueryWrapper<ConfigPO> wrapper) {
        return dao.selectOne(wrapper);
    }

    public boolean insertOrUpdate(ConfigPO po) {
        return dao.insertOrUpdate(po);
    }
}
